import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../components/Login.vue";

import UserManagement from "../components/UserManagement/MultiplexRouting.vue" //用户管理复用

import MultiplexRouting from "../components/MultiplexRouting/MultiplexRouting.vue" //商场管理复用
import CommodityCategory from "../components/MallManagement/CommodityCategory.vue" //商品类目
import OrderManagement from "../components/MallManagement/OrderManagement.vue" //订单管理

import CommodityManagement from "../components/CommodityManagement/MultiplexRouting.vue" //商品管理复用
import ProductList from "../components/CommodityManagement/ProductList.vue" //商品列表
import CommodityReview from "../components/CommodityManagement/CommodityReview.vue" //商品评论

import AdvertisingManagement from "../components/PromotionManagement/AdvertisingManagement.vue"  //广告管理
import CouponManagement from "../components/PromotionManagement/CouponManagement.vue" //优惠券管理
import ThematicManagement from "../components/PromotionManagement/ThematicManagement.vue" //专题管理
import PromotionManagement from "../components/PromotionManagement/MultiplexRouting.vue" //推广管理复用

import Administrators from "../components/SystemManagement/Administrators.vue" //管理员
import NotificatioManagement from "../components/SystemManagement/NotificatioManagement.vue" //通知管理
import RoleManagement from "../components/SystemManagement/RoleManagement.vue" //角色管理
import SystemManagement from "../components/SystemManagement/MultiplexRouting.vue" //系统管理复用

import ConfigurationManagement from "../components/ConfigurationManagement/MultiplexRouting.vue" //配置管理复用

import StatisticalReport from "../components/StatisticalReport/MultiplexRouting.vue" //统计报表复用

import OuterChain from "../components/OuterChain/MultiplexRouting.vue" //外链复用

Vue.use(VueRouter);

const routes = [{
		path: "/",
		name: "Login",
		component: Login,
		// redirect:"/index"
	},
	{
		path: "/index",
		name: "首页",
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
	},
	{ //用户管理
		path:"/UserManagement",
		name:"用户管理",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
		children:[
			{path:"MultiplexRouting",name:"用户管理复用路由",component: UserManagement}, //复用
		]
	},
	{  //商场管理
		path: "/MallManagement",
		name:"商场管理",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
		children: [
			{path: "MultiplexRouting",name: "商场管理复用路由",component: MultiplexRouting}, //复用
			{path: "CommodityCategory",name: "商品类目",component: CommodityCategory}, //商品类目
			{path:"OrderManagement",name:"订单管理",component:OrderManagement} //订单管理
		]
	},
	{ //商品管理
		path:"/CommodityManagement",
		name:"商品管理",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
		children:[
			{path:"ProductList",name:"商品列表",component:ProductList},  //商品列表
			{path:"CommodityReview",name:"商品评论",component:CommodityReview},  //商品评论
			{path:"MultiplexRouting",name:"商品管理复用路由",component:CommodityManagement} //商品管理复用
		]
	},
	{ //推广管理
		path:"/PromotionManagement",
		name:"推广管理",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
			children:[
				{path:"AdvertisingManagement",name:"广告管理",component:AdvertisingManagement} ,//广告管理
				{path:"CouponManagement",name:"优惠券管理",component:CouponManagement}, //优惠券管理
				{path:"ThematicManagement",name:"专题管理",component:ThematicManagement}, //专题管理
				{path:"MultiplexRouting",name:"推广管理复用路由",component:PromotionManagement} //推广管理复用
			]
	},
	{ //系统管理
		path:"/SystemManagement",
		name:"系统管理",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
			children:[
				{path:"Administrators",name:"管理员",component:Administrators}, //管理员
				{path:"NotificatioManagement",name:"通知管理",component:NotificatioManagement}, //通知管理
				{path:"RoleManagement",name:"角色管理",component:RoleManagement}, //角色管理
				{path:"MultiplexRouting",name:"系统管理复用路由",component:SystemManagement} //系统管理复用
			]
	},
	{ //配置管理
		path:"/ConfigurationManagement",
		name:"配置管理",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
		children:[
			{path:"MultiplexRouting",name:"配置管理复用路由",component:ConfigurationManagement} //配置管理复用
		]
	},
	{ //统计报表
		path:"/StatisticalReport",
		name:"统计报表",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
		children:[
			{path:"MultiplexRouting",name:"统计报表复用路由",component:StatisticalReport} //统计报表复用
		]
	},
	{  //外链
		path:"/OuterChain",
		name:"外链",
		component: () =>
			import( /* webpackChunkName: "about" */ "../components/Index.vue"),
		children:[
			{path:"MultiplexRouting",name:"外链复用路由",component:OuterChain}  //外链复用
		]
	}
];

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes,
});

export default router;
